package T01_test_all.test1;

import java.util.Random;

public class test01_Random_code {
    public static void main(String[] args) {
        char[] chs = new char[52];
        for (int i = 0; i < chs.length; i++) {
            if(i <= 25){
                chs[i] = (char)(97 + i);
            }else {
                chs[i] = (char)(65 + i - 26);
            }
        }
        for (int i = 0; i < chs.length; i++) {
//            System.out.print(chs[i] + " ");
        }
//        System.out.println();
        String result = "";
        Random r = new Random();
//        取随机的4位英文字母
        for (int i = 0; i < 4; i++) {
            int randomIndex = r.nextInt(chs.length);
            result = result + chs[randomIndex];
        }
//        取随机的以为数字
        int num = r.nextInt(10);
        result = result + num;
        System.out.println(result);
    }

}
